package ar.com.photo_admin.service.marshallers

import java.util.List;

import grails.converters.JSON

import ar.com.photo_admin.domain.*;
import ar.com.photo_admin.service.dto.*;

class AlbumMarshaller {
	
	void register() {
	
		JSON.registerObjectMarshaller(AlbumDTO) { AlbumDTO album ->
	
			return [			
				name : album.name,
				cover : album.cover,			
				photos : album.photos,
				description: album.description,
				status: album.status,	
				id: album.id
			]		
		}
		
		JSON.registerObjectMarshaller(AlbumLightWeightDTO) { AlbumLightWeightDTO album ->
			
			return [
				name : album.name,
				cover : album.cover,
				id: album.id
			]		
		}	
	}
}
